// src/pages/MerchantDashboard.js
import React, { useEffect, useState } from 'react';
import { jwtDecode } from 'jwt-decode';
import Navbar from '../components/Navbar';

const MerchantDashboard = () => {
  const [userData, setUserData] = useState(null);

  useEffect(() => {
    const token = localStorage.getItem('token');
    if (token) {
      const decoded = jwtDecode(token);
      setUserData(decoded);
    }
  }, []);

  return (
    <div>
      {userData && <Navbar userData={userData} />}
      <h3>商家界面</h3>
      {/* 商家特有内容 */}
    </div>
  );
};

export default MerchantDashboard;

